package wsz.rocketmq.consumer;

import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

/**
 * @author wsz
 * @date 2022/2/23 12:22
 **/
@Slf4j
@Component
@RocketMQMessageListener(topic = "springboot-mq", consumerGroup = "springboot-consumer-wsz")
public class MQConsumer implements RocketMQListener<String> {
    @Override
    public void onMessage(String s) {
        log.info("消费者接收消息");
        log.info(s);
    }
}
